package model;

import java.util.*;

public enum ReservationStatus
{
	UNDEFINED(0,"undefined"),
	PENDING (1,"Awaiting aprovement"),
	APPROVED (2, "Approved");
	
	/* FIELDS */
	private final int index;
	private final String value;
	private static final Map<Integer,ReservationStatus> lookup = new HashMap<Integer,ReservationStatus>();
	
	/* CONSTRUCTORS */
	private ReservationStatus(int index, String value) 
	{
        this.index = index;
        this.value = value;
    }
	static 
	{
	    for(ReservationStatus ct : EnumSet.allOf(ReservationStatus.class))
	         lookup.put(ct.getIndex(), ct);
	}
	/* ACCESSORS */
	public int getIndex()
	{
		return this.index;
	}
	public String getValue()
	{
		return this.value;
	}
	public static ReservationStatus getStatus(int index) { 
        return lookup.get(index); 
   }

}